<div ng-controller="userUnitController">

    <div class="query_criteria">
        <div class="selece_tj userUnitSelect_box">
            <p>
                <span>设备编号：<input class="laydate-icon" type="text" ng-model="code" placeholder="设备编号"/> </span>
                <span>设备种类：</span>
                <select  ng-model="selectUnit"  ng-options="s.id as s.name for s in getUnitDate" style="width:100px;">
                <option value=" ">请选择</option>
                </select>
                <span>设备名称：<input class="laydate-icon" type="text" ng-model="unitName" placeholder="设备名称"/> </span>
                <span>终端编号：<input class="laydate-icon" type="text" ng-model="unitZDcode" placeholder="终端编号"/> </span>
                <a href="javascript:void(0)" class="userUnit_select" ng-click="getUserUnitList()"> 查 询</a>
            </p>
        </div>
    </div>

    <div class="queryDivBox">
        <div class="query_table" style=" height:372px !important; overflow-y: auto; overflow-x: hidden">

            <table class="table table-bordered table-striped">
                <tr>
                    <td>设备编号</td>
                    <td>设备名称</td>
                    <td>设备种类</td>
                    <td>推送方式</td>
                    <!--<td>推送间隔</td>-->
                    <td>所属实验室</td>
                    <td>操作</td>
                </tr>
                <tr ng-repeat="unit in getUserDevice">
                    <td ng-bind="unit.code"></td>
                    <td ng-bind="unit.name"></td>
                    <td ng-bind="unit.deviceType.name"></td>
                    <td ng-bind="unit.pushType"></td>
                    <!--<td ng-bind="unit.pushInterval"></td>-->
                    <td ng-bind="unit.roomName"></td>
                    <td>
                        <a href="javascript:void(0)" data-toggle="modal" data-target="#deleteUnit"
                           data-backdrop="static" ng-click="deleteUnitInit(unit)" style="color: red; padding-right: 10px;">删除</a>
                        <a href="javascript:void(0)" class="Tab-update" ng-click="redirect('unit_Details.html/' + unit.id)">详 情</a>
                    </td>

                </tr>

            </table>

        </div>
        <div class="pagination datapager fr pr20">
            <ul>
                <li ng-class="{disabled: pageIndex == 0}"><a href="javascript:void(0)" ng-click="prevPage()">上一页</a>
                </li>
                <!--<li><a href="#">当前页 {{pageIndex+1}}</a></li>-->
                <li ng-repeat="n in range(pageTotal)"
                    ng-class="{active: n == pageIndex}"
                    ng-click="setPage()">
                    <a href="javascript:void(0)" ng-bind="n + 1">1</a>
                </li>
                <li ng-class="{disabled: pageIndex == pageTotal - 1}"><a href="javascript:void(0)"
                                                                         ng-click="nextPage()">下一页</a></li>
                <li class="page_allShow"><a href="javascript:void(0)">共<span>{{total}}</span>条</a></li>
            </ul>

        </div>
    </div>

    <!-- Modal---删除设备类型-->
    <div id="deleteUnit" class="modal hide fade" tabindex="-1" role="dialog"
         aria-labelledby="deleteUnitLable"
         aria-hidden="true">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h4 id="deleteUnitType">删除当前设备</h4>
        </div>
        <div class="modal-body" style="min-height: 50px !important;">
            <div class="container" style="width:500px;">
                <div class="add_tj">
                    <div style="font-size: 14px; text-align: center">
                        确认要删除该设备吗？
                    </div>
                </div>
            </div>
        </div>
        <div class="modal-footer">
            <button class="btn" data-dismiss="modal" aria-hidden="true">关 闭</button>
            <button class="btn btn-primary" data-dismiss="modal" aria-hidden="true"
                    ng-click="SavedeleteUnitInfo()">保 存
            </button>
        </div>
    </div>
</div>